<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/answerCardPublic.css">
</head>

<body>
    <div class="answer-box">
        <p class="title">新建答题卡<span class="close-icon"></span></p>
        <div class="answer-main">
            <ul>
                <li>
                    大标题：<span class="fl-r"></span>
                    <input id="title" type="text" class="handline-inp" placeholder="2018-2019学年度第一学期期中考试">
                </li>
                <li class="children-s">
                    <div>
                        <span>试题编号:</span><input id="min-num" class="num-inp" type="text" value="5">&nbsp;-&nbsp;<input
                            type="text" class="num-inp" value="20" id="max-num">
                    </div>
                </li>
                <li class="children-s">
                    <div><span>每题行数：</span><input type="text" style="width:60px;" id="row-num"></div>
                </li>
            </ul>
        </div>
        <div class="btn-box">
            <input class="save" type="button" value="保存" id="save">
            <input class="cancel" type="button" value="取消">
        </div>
    </div>
    <script src="./js/public.js"></script>
    <script>
        save.onclick = function () {
            var paramObj = {
                title: getNodeval("title"),
                minNum: parseInt(getNodeval("min-num")),
                maxNum: parseInt(getNodeval("max-num")),
                rowNum: parseInt(getNodeval("row-num")),
                topictype: 'saq',
                foreachtype: "line",
                childrenForEach: true
            }
            createTopicCard(paramObj)
            eventC()
        }

        function eventC() {
            var linebox = document.getElementsByClassName("linebox");
            for (var i = 0; i < linebox.length; i++) {
                var tagnode = linebox[i].children
                for (let i = 0; i < tagnode.length; i++) {
                    tagnode[i].addEventListener("click", function (e) {
                        e = e || windwo.event;
                        var div = e.currentTarget;
                        div.setAttribute("contenteditable", true)
                        div.style.cssText = "background:red;border:solid 1px red;margin: 50px;padding:50px;"
                    })
                }
            }
        }
    </script>
</body>

</html>